package com.wn.springAOP.service.advice;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class MyAspect implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
       beforeAdvice();

        Object proceed = invocation.proceed();

        afterAdvice();

        return proceed;
    }

    private void afterAdvice() {
        System.out.println("MyAspect.beforeAdvice：方法执行之后……");
    }

    private void beforeAdvice() {
        System.out.println("MyAspect.beforeAdvice：方法执行之前……");
    }
}
